﻿/**
 * 
 * @file BrowserTableHandlerMaterialAbstract.h
 * @brief 材料表格处理器抽象类声明
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-12-05
 * 
 */
#ifndef _BEOWSERTABLE_HANDLER_MATERIAL_Abstract_H___
#define _BEOWSERTABLE_HANDLER_MATERIAL_Abstract_H___

#include "WidgetBrowserTable.h"

namespace EventOper
{
    class OperAbstractMaterial;
}

namespace GUI
{
    /**
     * @brief 材料表格处理器抽象类
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-12-05
     */
    class GUIWIDGETAPI BrowserTableHandlerMaterialAbstract : public BrowserTableAbstractHandler
    {
        Q_OBJECT
    public:
        /**
         * @brief 构造函数
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        using BrowserTableAbstractHandler::BrowserTableAbstractHandler;
        /**
         * @brief 析构函数
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        virtual ~BrowserTableHandlerMaterialAbstract() = 0;
        /**
         * @brief 右键菜单
         * @param[i]  popMenu        右键菜单
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        virtual void contextMenu(QMenu* popMenu) override;
        /**
         * @brief 表头右键菜单
         * @param[i]  popMenu        右键菜单
         * @param[i]  coluIndex      列索引
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        virtual void headerContextMenu(QMenu* popMenu, int coluIndex) override;

        /**
        * @brief 单元格双击
        * @param[i]  row         行索引
        * @param[i]  colum         列索引
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-12-05
        */
        virtual void itemDoubleClicked(int row, int colum) override;
        
    protected:
        /**
         * @brief 获取操作器
         * @return EventOper::OperAbstractMaterial* 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        virtual EventOper::OperAbstractMaterial* getMaterialOper() = 0;
        /**
         * @brief 是否允许批量修改 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-09
         */
        virtual bool enableAttriSet();

   private slots:
        /**
         * @brief 编辑材料
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        void editMaterialSlot();
        /**
         * @brief 新增材料
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        void createMaterialSlot();
        /**
         * @brief 复制材料
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        void duplicateMaterialSlot();
        /**
         * @brief 移除材料
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        void removeMaterialSlot();
        /**
         * @brief 设置属性
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-12-05
         */
        void setAttributeSlot();
         
    };
}


#endif
